Method: Sequel::Postgres::PGRowOp#[]

Defined in:
lib/sequel/extensions/pg_row_ops.rb

#[](member) ⇒ Object

Access a member of the composite type if given a symbol or an SQL::Identifier. For all other access, assuming the pg_array_ops extension is loaded and that it represents an array access. In either case, return a PgRowOp so that access can be cascaded.

[View source]

107
108
109
110
111
112
113
114
# File 'lib/sequel/extensions/pg_row_ops.rb', line 107

def [](member)
  case member
  when Symbol, SQL::Identifier
    PGRowOp.new(QUALIFY, [self, member])
  else
    PGRowOp.wrap(Sequel.pg_array_op(self)[member])
  end
end